﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using HslCommunication.BasicFramework;
using HslCommunication.Core;
using HslCommunication.Core.Net;
using HslCommunication.Reflection;
using HslCommunication.Serial;

namespace HslCommunication.ModBus
{
	/// <inheritdoc cref="T:HslCommunication.ModBus.ModbusRtu" />
	// Token: 0x020000D0 RID: 208
	public class ModbusRtuOverTcp : NetworkDeviceBase
	{
		/// <inheritdoc cref="M:HslCommunication.ModBus.ModbusRtu.#ctor" />
		// Token: 0x06000FB6 RID: 4022 RVA: 0x0005B9B7 File Offset: 0x00059BB7
		public ModbusRtuOverTcp()
		{
			base.ByteTransform = new ReverseWordTransform();
			base.WordLength = 1;
			this.station = 1;
			base.SleepTime = 20;
		}

		/// <inheritdoc cref="M:HslCommunication.ModBus.ModbusTcpNet.#ctor(System.String,System.Int32,System.Byte)" />
		// Token: 0x06000FB7 RID: 4023 RVA: 0x0005B9F4 File Offset: 0x00059BF4
		public ModbusRtuOverTcp(string ipAddress, int port = 502, byte station = 1)
		{
			base.ByteTransform = new ReverseWordTransform();
			this.IpAddress = ipAddress;
			this.Port = port;
			base.WordLength = 1;
			this.station = station;
			base.SleepTime = 20;
		}

		/// <inheritdoc cref="P:HslCommunication.ModBus.ModbusTcpNet.AddressStartWithZero" />
		// Token: 0x17000247 RID: 583
		// (get) Token: 0x06000FB8 RID: 4024 RVA: 0x0005BA4C File Offset: 0x00059C4C
		// (set) Token: 0x06000FB9 RID: 4025 RVA: 0x0005BA64 File Offset: 0x00059C64
		public bool AddressStartWithZero
		{
			get
			{
				return this.isAddressStartWithZero;
			}
			set
			{
				this.isAddressStartWithZero = value;
			}
		}

		/// <inheritdoc cref="P:HslCommunication.ModBus.ModbusTcpNet.Station" />
		// Token: 0x17000248 RID: 584
		// (get) Token: 0x06000FBA RID: 4026 RVA: 0x0005BA70 File Offset: 0x00059C70
		// (set) Token: 0x06000FBB RID: 4027 RVA: 0x0005BA88 File Offset: 0x00059C88
		public byte Station
		{
			get
			{
				return this.station;
			}
			set
			{
				this.station = value;
			}
		}

		/// <inheritdoc cref="P:HslCommunication.ModBus.ModbusTcpNet.DataFormat" />
		// Token: 0x17000249 RID: 585
		// (get) Token: 0x06000FBC RID: 4028 RVA: 0x0005BA94 File Offset: 0x00059C94
		// (set) Token: 0x06000FBD RID: 4029 RVA: 0x0005BAB1 File Offset: 0x00059CB1
		public DataFormat DataFormat
		{
			get
			{
				return base.ByteTransform.DataFormat;
			}
			set
			{
				base.ByteTransform.DataFormat = value;
			}
		}

		/// <inheritdoc cref="P:HslCommunication.ModBus.ModbusTcpNet.IsStringReverse" />
		// Token: 0x1700024A RID: 586
		// (get) Token: 0x06000FBE RID: 4030 RVA: 0x0005BAC4 File Offset: 0x00059CC4
		// (set) Token: 0x06000FBF RID: 4031 RVA: 0x0005BAE1 File Offset: 0x00059CE1
		public bool IsStringReverse
		{
			get
			{
				return base.ByteTransform.IsStringReverseByteWord;
			}
			set
			{
				base.ByteTransform.IsStringReverseByteWord = value;
			}
		}

		/// <inheritdoc cref="M:HslCommunication.ModBus.ModbusRtu.CheckModbusTcpResponse(System.Byte[])" />
		// Token: 0x06000FC0 RID: 4032 RVA: 0x0005BAF4 File Offset: 0x00059CF4
		protected virtual OperateResult<byte[]> CheckModbusTcpResponse(byte[] send)
		{
			send = ModbusInfo.PackCommandToRtu(send);
			OperateResult<byte[]> operateResult = base.ReadFromCoreServer(send);
			bool flag = !operateResult.IsSuccess;
			OperateResult<byte[]> result;
			if (flag)
			{
				result = operateResult;
			}
			else
			{
				bool flag2 = operateResult.Content.Length < 5;
				if (flag2)
				{
					result = new OperateResult<byte[]>(StringResources.Language.ReceiveDataLengthTooShort + "5");
				}
				else
				{
					bool flag3 = !SoftCRC16.CheckCRC16(operateResult.Content);
					if (flag3)
					{
						result = new OperateResult<byte[]>(StringResources.Language.ModbusCRCCheckFailed + SoftBasic.ByteToHexString(operateResult.Content, ' '));
					}
					else
					{
						bool flag4 = send[1] + 128 == operateResult.Content[1];
						if (flag4)
						{
							result = new OperateResult<byte[]>((int)operateResult.Content[2], ModbusInfo.GetDescriptionByErrorCode(operateResult.Content[2]));
						}
						else
						{
							bool flag5 = send[1] != operateResult.Content[1];
							if (flag5)
							{
								result = new OperateResult<byte[]>((int)operateResult.Content[1], "Receive Command Check Failed: ");
							}
							else
							{
								result = ModbusInfo.ExtractActualData(ModbusInfo.ExplodeRtuCommandToCore(operateResult.Content));
							}
						}
					}
				}
			}
			return result;
		}

		/// <inheritdoc cref="M:HslCommunication.ModBus.ModbusRtuOverTcp.CheckModbusTcpResponse(System.Byte[])" />
		// Token: 0x06000FC1 RID: 4033 RVA: 0x0005BC04 File Offset: 0x00059E04
		[DebuggerStepThrough]
		protected virtual Task<OperateResult<byte[]>> CheckModbusTcpResponseAsync(byte[] send)
		{
			ModbusRtuOverTcp.<CheckModbusTcpResponseAsync>d__17 <CheckModbusTcpResponseAsync>d__ = new ModbusRtuOverTcp.<CheckModbusTcpResponseAsync>d__17();
			<CheckModbusTcpResponseAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<byte[]>>.Create();
			<CheckModbusTcpResponseAsync>d__.<>4__this = this;
			<CheckModbusTcpResponseAsync>d__.send = send;
			<CheckModbusTcpResponseAsync>d__.<>1__state = -1;
			<CheckModbusTcpResponseAsync>d__.<>t__builder.Start<ModbusRtuOverTcp.<CheckModbusTcpResponseAsync>d__17>(ref <CheckModbusTcpResponseAsync>d__);
			return <CheckModbusTcpResponseAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.ModBus.ModbusTcpNet.ReadCoil(System.String)" />
		// Token: 0x06000FC2 RID: 4034 RVA: 0x0003AED6 File Offset: 0x000390D6
		public OperateResult<bool> ReadCoil(string address)
		{
			return this.ReadBool(address);
		}

		/// <inheritdoc cref="M:HslCommunication.ModBus.ModbusTcpNet.ReadCoil(System.String,System.UInt16)" />
		// Token: 0x06000FC3 RID: 4035 RVA: 0x0003AEDF File Offset: 0x000390DF
		public OperateResult<bool[]> ReadCoil(string address, ushort length)
		{
			return this.ReadBool(address, length);
		}

		/// <inheritdoc cref="M:HslCommunication.ModBus.ModbusTcpNet.ReadDiscrete(System.String)" />
		// Token: 0x06000FC4 RID: 4036 RVA: 0x0005BC4F File Offset: 0x00059E4F
		public OperateResult<bool> ReadDiscrete(string address)
		{
			return ByteTransformHelper.GetResultFromArray<bool>(this.ReadDiscrete(address, 1));
		}

		/// <inheritdoc cref="M:HslCommunication.ModBus.ModbusTcpNet.ReadDiscrete(System.String,System.UInt16)" />
		// Token: 0x06000FC5 RID: 4037 RVA: 0x0005BC5E File Offset: 0x00059E5E
		public OperateResult<bool[]> ReadDiscrete(string address, ushort length)
		{
			return this.ReadBoolHelper(address, length, 2);
		}

		/// <inheritdoc cref="M:HslCommunication.ModBus.ModbusTcpNet.Read(System.String,System.UInt16)" />
		// Token: 0x06000FC6 RID: 4038 RVA: 0x0005BC6C File Offset: 0x00059E6C
		[HslMqttApi("ReadByteArray", "")]
		public override OperateResult<byte[]> Read(string address, ushort length)
		{
			OperateResult<byte[][]> operateResult = ModbusInfo.BuildReadModbusCommand(address, length, this.Station, this.AddressStartWithZero, 3);
			bool flag = !operateResult.IsSuccess;
			OperateResult<byte[]> result;
			if (flag)
			{
				result = OperateResult.CreateFailedResult<byte[]>(operateResult);
			}
			else
			{
				List<byte> list = new List<byte>();
				for (int i = 0; i < operateResult.Content.Length; i++)
				{
					OperateResult<byte[]> operateResult2 = this.CheckModbusTcpResponse(operateResult.Content[i]);
					bool flag2 = !operateResult2.IsSuccess;
					if (flag2)
					{
						return OperateResult.CreateFailedResult<byte[]>(operateResult2);
					}
					list.AddRange(operateResult2.Content);
				}
				result = OperateResult.CreateSuccessResult<byte[]>(list.ToArray());
			}
			return result;
		}

		/// <inheritdoc cref="M:HslCommunication.ModBus.ModbusTcpNet.Write(System.String,System.Byte[])" />
		// Token: 0x06000FC7 RID: 4039 RVA: 0x0005BD14 File Offset: 0x00059F14
		[HslMqttApi("WriteByteArray", "")]
		public override OperateResult Write(string address, byte[] value)
		{
			OperateResult<byte[]> operateResult = ModbusInfo.BuildWriteWordModbusCommand(address, value, this.Station, this.AddressStartWithZero, 16);
			bool flag = !operateResult.IsSuccess;
			OperateResult result;
			if (flag)
			{
				result = operateResult;
			}
			else
			{
				result = this.CheckModbusTcpResponse(operateResult.Content);
			}
			return result;
		}

		/// <inheritdoc cref="M:HslCommunication.ModBus.ModbusTcpNet.Write(System.String,System.Int16)" />
		// Token: 0x06000FC8 RID: 4040 RVA: 0x0005BD5C File Offset: 0x00059F5C
		[HslMqttApi("WriteInt16", "")]
		public override OperateResult Write(string address, short value)
		{
			OperateResult<byte[]> operateResult = ModbusInfo.BuildWriteWordModbusCommand(address, value, this.Station, this.AddressStartWithZero, 6);
			bool flag = !operateResult.IsSuccess;
			OperateResult result;
			if (flag)
			{
				result = operateResult;
			}
			else
			{
				result = this.CheckModbusTcpResponse(operateResult.Content);
			}
			return result;
		}

		/// <inheritdoc cref="M:HslCommunication.ModBus.ModbusTcpNet.Write(System.String,System.UInt16)" />
		// Token: 0x06000FC9 RID: 4041 RVA: 0x0005BDA0 File Offset: 0x00059FA0
		[HslMqttApi("WriteUInt16", "")]
		public override OperateResult Write(string address, ushort value)
		{
			OperateResult<byte[]> operateResult = ModbusInfo.BuildWriteWordModbusCommand(address, value, this.Station, this.AddressStartWithZero, 6);
			bool flag = !operateResult.IsSuccess;
			OperateResult result;
			if (flag)
			{
				result = operateResult;
			}
			else
			{
				result = this.CheckModbusTcpResponse(operateResult.Content);
			}
			return result;
		}

		/// <inheritdoc cref="M:HslCommunication.ModBus.ModbusTcpNet.WriteMask(System.String,System.UInt16,System.UInt16)" />
		// Token: 0x06000FCA RID: 4042 RVA: 0x0005BDE4 File Offset: 0x00059FE4
		[HslMqttApi("WriteMask", "")]
		public OperateResult WriteMask(string address, ushort andMask, ushort orMask)
		{
			OperateResult<byte[]> operateResult = ModbusInfo.BuildWriteMaskModbusCommand(address, andMask, orMask, this.Station, this.AddressStartWithZero, 22);
			bool flag = !operateResult.IsSuccess;
			OperateResult result;
			if (flag)
			{
				result = operateResult;
			}
			else
			{
				result = this.CheckModbusTcpResponse(operateResult.Content);
			}
			return result;
		}

		/// <inheritdoc cref="M:HslCommunication.ModBus.ModbusRtuOverTcp.Write(System.String,System.Int16)" />
		// Token: 0x06000FCB RID: 4043 RVA: 0x0005BE2A File Offset: 0x0005A02A
		public OperateResult WriteOneRegister(string address, short value)
		{
			return this.Write(address, value);
		}

		/// <inheritdoc cref="M:HslCommunication.ModBus.ModbusRtuOverTcp.Write(System.String,System.UInt16)" />
		// Token: 0x06000FCC RID: 4044 RVA: 0x0005BE34 File Offset: 0x0005A034
		public OperateResult WriteOneRegister(string address, ushort value)
		{
			return this.Write(address, value);
		}

		/// <inheritdoc cref="M:HslCommunication.ModBus.ModbusTcpNet.ReadCoilAsync(System.String)" />
		// Token: 0x06000FCD RID: 4045 RVA: 0x0005BE40 File Offset: 0x0005A040
		[DebuggerStepThrough]
		public Task<OperateResult<bool>> ReadCoilAsync(string address)
		{
			ModbusRtuOverTcp.<ReadCoilAsync>d__29 <ReadCoilAsync>d__ = new ModbusRtuOverTcp.<ReadCoilAsync>d__29();
			<ReadCoilAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<bool>>.Create();
			<ReadCoilAsync>d__.<>4__this = this;
			<ReadCoilAsync>d__.address = address;
			<ReadCoilAsync>d__.<>1__state = -1;
			<ReadCoilAsync>d__.<>t__builder.Start<ModbusRtuOverTcp.<ReadCoilAsync>d__29>(ref <ReadCoilAsync>d__);
			return <ReadCoilAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.ModBus.ModbusTcpNet.ReadCoilAsync(System.String,System.UInt16)" />
		// Token: 0x06000FCE RID: 4046 RVA: 0x0005BE8C File Offset: 0x0005A08C
		[DebuggerStepThrough]
		public Task<OperateResult<bool[]>> ReadCoilAsync(string address, ushort length)
		{
			ModbusRtuOverTcp.<ReadCoilAsync>d__30 <ReadCoilAsync>d__ = new ModbusRtuOverTcp.<ReadCoilAsync>d__30();
			<ReadCoilAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<bool[]>>.Create();
			<ReadCoilAsync>d__.<>4__this = this;
			<ReadCoilAsync>d__.address = address;
			<ReadCoilAsync>d__.length = length;
			<ReadCoilAsync>d__.<>1__state = -1;
			<ReadCoilAsync>d__.<>t__builder.Start<ModbusRtuOverTcp.<ReadCoilAsync>d__30>(ref <ReadCoilAsync>d__);
			return <ReadCoilAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.ModBus.ModbusTcpNet.ReadDiscreteAsync(System.String)" />
		// Token: 0x06000FCF RID: 4047 RVA: 0x0005BEE0 File Offset: 0x0005A0E0
		[DebuggerStepThrough]
		public Task<OperateResult<bool>> ReadDiscreteAsync(string address)
		{
			ModbusRtuOverTcp.<ReadDiscreteAsync>d__31 <ReadDiscreteAsync>d__ = new ModbusRtuOverTcp.<ReadDiscreteAsync>d__31();
			<ReadDiscreteAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<bool>>.Create();
			<ReadDiscreteAsync>d__.<>4__this = this;
			<ReadDiscreteAsync>d__.address = address;
			<ReadDiscreteAsync>d__.<>1__state = -1;
			<ReadDiscreteAsync>d__.<>t__builder.Start<ModbusRtuOverTcp.<ReadDiscreteAsync>d__31>(ref <ReadDiscreteAsync>d__);
			return <ReadDiscreteAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.ModBus.ModbusTcpNet.ReadDiscreteAsync(System.String,System.UInt16)" />
		// Token: 0x06000FD0 RID: 4048 RVA: 0x0005BF2C File Offset: 0x0005A12C
		[DebuggerStepThrough]
		public Task<OperateResult<bool[]>> ReadDiscreteAsync(string address, ushort length)
		{
			ModbusRtuOverTcp.<ReadDiscreteAsync>d__32 <ReadDiscreteAsync>d__ = new ModbusRtuOverTcp.<ReadDiscreteAsync>d__32();
			<ReadDiscreteAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<bool[]>>.Create();
			<ReadDiscreteAsync>d__.<>4__this = this;
			<ReadDiscreteAsync>d__.address = address;
			<ReadDiscreteAsync>d__.length = length;
			<ReadDiscreteAsync>d__.<>1__state = -1;
			<ReadDiscreteAsync>d__.<>t__builder.Start<ModbusRtuOverTcp.<ReadDiscreteAsync>d__32>(ref <ReadDiscreteAsync>d__);
			return <ReadDiscreteAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.ModBus.ModbusTcpNet.ReadAsync(System.String,System.UInt16)" />
		// Token: 0x06000FD1 RID: 4049 RVA: 0x0005BF80 File Offset: 0x0005A180
		[DebuggerStepThrough]
		public override Task<OperateResult<byte[]>> ReadAsync(string address, ushort length)
		{
			ModbusRtuOverTcp.<ReadAsync>d__33 <ReadAsync>d__ = new ModbusRtuOverTcp.<ReadAsync>d__33();
			<ReadAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<byte[]>>.Create();
			<ReadAsync>d__.<>4__this = this;
			<ReadAsync>d__.address = address;
			<ReadAsync>d__.length = length;
			<ReadAsync>d__.<>1__state = -1;
			<ReadAsync>d__.<>t__builder.Start<ModbusRtuOverTcp.<ReadAsync>d__33>(ref <ReadAsync>d__);
			return <ReadAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.ModBus.ModbusTcpNet.WriteAsync(System.String,System.Byte[])" />
		// Token: 0x06000FD2 RID: 4050 RVA: 0x0005BFD4 File Offset: 0x0005A1D4
		[DebuggerStepThrough]
		public override Task<OperateResult> WriteAsync(string address, byte[] value)
		{
			ModbusRtuOverTcp.<WriteAsync>d__34 <WriteAsync>d__ = new ModbusRtuOverTcp.<WriteAsync>d__34();
			<WriteAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<WriteAsync>d__.<>4__this = this;
			<WriteAsync>d__.address = address;
			<WriteAsync>d__.value = value;
			<WriteAsync>d__.<>1__state = -1;
			<WriteAsync>d__.<>t__builder.Start<ModbusRtuOverTcp.<WriteAsync>d__34>(ref <WriteAsync>d__);
			return <WriteAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.ModBus.ModbusTcpNet.WriteOneRegisterAsync(System.String,System.Int16)" />
		// Token: 0x06000FD3 RID: 4051 RVA: 0x0005C028 File Offset: 0x0005A228
		[DebuggerStepThrough]
		public Task<OperateResult> WriteOneRegisterAsync(string address, short value)
		{
			ModbusRtuOverTcp.<WriteOneRegisterAsync>d__35 <WriteOneRegisterAsync>d__ = new ModbusRtuOverTcp.<WriteOneRegisterAsync>d__35();
			<WriteOneRegisterAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<WriteOneRegisterAsync>d__.<>4__this = this;
			<WriteOneRegisterAsync>d__.address = address;
			<WriteOneRegisterAsync>d__.value = value;
			<WriteOneRegisterAsync>d__.<>1__state = -1;
			<WriteOneRegisterAsync>d__.<>t__builder.Start<ModbusRtuOverTcp.<WriteOneRegisterAsync>d__35>(ref <WriteOneRegisterAsync>d__);
			return <WriteOneRegisterAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.ModBus.ModbusTcpNet.WriteOneRegisterAsync(System.String,System.UInt16)" />
		// Token: 0x06000FD4 RID: 4052 RVA: 0x0005C07C File Offset: 0x0005A27C
		[DebuggerStepThrough]
		public Task<OperateResult> WriteOneRegisterAsync(string address, ushort value)
		{
			ModbusRtuOverTcp.<WriteOneRegisterAsync>d__36 <WriteOneRegisterAsync>d__ = new ModbusRtuOverTcp.<WriteOneRegisterAsync>d__36();
			<WriteOneRegisterAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<WriteOneRegisterAsync>d__.<>4__this = this;
			<WriteOneRegisterAsync>d__.address = address;
			<WriteOneRegisterAsync>d__.value = value;
			<WriteOneRegisterAsync>d__.<>1__state = -1;
			<WriteOneRegisterAsync>d__.<>t__builder.Start<ModbusRtuOverTcp.<WriteOneRegisterAsync>d__36>(ref <WriteOneRegisterAsync>d__);
			return <WriteOneRegisterAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.ModBus.ModbusRtuOverTcp.WriteMask(System.String,System.UInt16,System.UInt16)" />
		// Token: 0x06000FD5 RID: 4053 RVA: 0x0005C0D0 File Offset: 0x0005A2D0
		[DebuggerStepThrough]
		public Task<OperateResult> WriteMaskAsync(string address, ushort andMask, ushort orMask)
		{
			ModbusRtuOverTcp.<WriteMaskAsync>d__37 <WriteMaskAsync>d__ = new ModbusRtuOverTcp.<WriteMaskAsync>d__37();
			<WriteMaskAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<WriteMaskAsync>d__.<>4__this = this;
			<WriteMaskAsync>d__.address = address;
			<WriteMaskAsync>d__.andMask = andMask;
			<WriteMaskAsync>d__.orMask = orMask;
			<WriteMaskAsync>d__.<>1__state = -1;
			<WriteMaskAsync>d__.<>t__builder.Start<ModbusRtuOverTcp.<WriteMaskAsync>d__37>(ref <WriteMaskAsync>d__);
			return <WriteMaskAsync>d__.<>t__builder.Task;
		}

		// Token: 0x06000FD6 RID: 4054 RVA: 0x0005C12C File Offset: 0x0005A32C
		private OperateResult<bool[]> ReadBoolHelper(string address, ushort length, byte function)
		{
			OperateResult<byte[][]> operateResult = ModbusInfo.BuildReadModbusCommand(address, length, this.Station, this.AddressStartWithZero, function);
			bool flag = !operateResult.IsSuccess;
			OperateResult<bool[]> result;
			if (flag)
			{
				result = OperateResult.CreateFailedResult<bool[]>(operateResult);
			}
			else
			{
				List<bool> list = new List<bool>();
				for (int i = 0; i < operateResult.Content.Length; i++)
				{
					OperateResult<byte[]> operateResult2 = this.CheckModbusTcpResponse(operateResult.Content[i]);
					bool flag2 = !operateResult2.IsSuccess;
					if (flag2)
					{
						return OperateResult.CreateFailedResult<bool[]>(operateResult2);
					}
					int length2 = (int)operateResult.Content[i][4] * 256 + (int)operateResult.Content[i][5];
					list.AddRange(SoftBasic.ByteToBoolArray(operateResult2.Content, length2));
				}
				result = OperateResult.CreateSuccessResult<bool[]>(list.ToArray());
			}
			return result;
		}

		/// <inheritdoc cref="M:HslCommunication.ModBus.ModbusTcpNet.ReadBool(System.String,System.UInt16)" />
		// Token: 0x06000FD7 RID: 4055 RVA: 0x0005C1FB File Offset: 0x0005A3FB
		[HslMqttApi("ReadBoolArray", "")]
		public override OperateResult<bool[]> ReadBool(string address, ushort length)
		{
			return this.ReadBoolHelper(address, length, 1);
		}

		/// <inheritdoc cref="M:HslCommunication.ModBus.ModbusTcpNet.Write(System.String,System.Boolean[])" />
		// Token: 0x06000FD8 RID: 4056 RVA: 0x0005C208 File Offset: 0x0005A408
		[HslMqttApi("WriteBoolArray", "")]
		public override OperateResult Write(string address, bool[] values)
		{
			OperateResult<byte[]> operateResult = ModbusInfo.BuildWriteBoolModbusCommand(address, values, this.Station, this.AddressStartWithZero, 15);
			bool flag = !operateResult.IsSuccess;
			OperateResult result;
			if (flag)
			{
				result = operateResult;
			}
			else
			{
				result = this.CheckModbusTcpResponse(operateResult.Content);
			}
			return result;
		}

		/// <inheritdoc cref="M:HslCommunication.ModBus.ModbusTcpNet.Write(System.String,System.Boolean)" />
		// Token: 0x06000FD9 RID: 4057 RVA: 0x0005C250 File Offset: 0x0005A450
		[HslMqttApi("WriteBool", "")]
		public override OperateResult Write(string address, bool value)
		{
			OperateResult<byte[]> operateResult = ModbusInfo.BuildWriteBoolModbusCommand(address, value, this.Station, this.AddressStartWithZero, 5);
			bool flag = !operateResult.IsSuccess;
			OperateResult result;
			if (flag)
			{
				result = operateResult;
			}
			else
			{
				result = this.CheckModbusTcpResponse(operateResult.Content);
			}
			return result;
		}

		// Token: 0x06000FDA RID: 4058 RVA: 0x0005C294 File Offset: 0x0005A494
		[DebuggerStepThrough]
		private Task<OperateResult<bool[]>> ReadBoolHelperAsync(string address, ushort length, byte function)
		{
			ModbusRtuOverTcp.<ReadBoolHelperAsync>d__42 <ReadBoolHelperAsync>d__ = new ModbusRtuOverTcp.<ReadBoolHelperAsync>d__42();
			<ReadBoolHelperAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<bool[]>>.Create();
			<ReadBoolHelperAsync>d__.<>4__this = this;
			<ReadBoolHelperAsync>d__.address = address;
			<ReadBoolHelperAsync>d__.length = length;
			<ReadBoolHelperAsync>d__.function = function;
			<ReadBoolHelperAsync>d__.<>1__state = -1;
			<ReadBoolHelperAsync>d__.<>t__builder.Start<ModbusRtuOverTcp.<ReadBoolHelperAsync>d__42>(ref <ReadBoolHelperAsync>d__);
			return <ReadBoolHelperAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.ModBus.ModbusTcpNet.ReadBoolAsync(System.String,System.UInt16)" />
		// Token: 0x06000FDB RID: 4059 RVA: 0x0005C2F0 File Offset: 0x0005A4F0
		[DebuggerStepThrough]
		public override Task<OperateResult<bool[]>> ReadBoolAsync(string address, ushort length)
		{
			ModbusRtuOverTcp.<ReadBoolAsync>d__43 <ReadBoolAsync>d__ = new ModbusRtuOverTcp.<ReadBoolAsync>d__43();
			<ReadBoolAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<bool[]>>.Create();
			<ReadBoolAsync>d__.<>4__this = this;
			<ReadBoolAsync>d__.address = address;
			<ReadBoolAsync>d__.length = length;
			<ReadBoolAsync>d__.<>1__state = -1;
			<ReadBoolAsync>d__.<>t__builder.Start<ModbusRtuOverTcp.<ReadBoolAsync>d__43>(ref <ReadBoolAsync>d__);
			return <ReadBoolAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.ModBus.ModbusTcpNet.WriteAsync(System.String,System.Boolean[])" />
		// Token: 0x06000FDC RID: 4060 RVA: 0x0005C344 File Offset: 0x0005A544
		[DebuggerStepThrough]
		public override Task<OperateResult> WriteAsync(string address, bool[] values)
		{
			ModbusRtuOverTcp.<WriteAsync>d__44 <WriteAsync>d__ = new ModbusRtuOverTcp.<WriteAsync>d__44();
			<WriteAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<WriteAsync>d__.<>4__this = this;
			<WriteAsync>d__.address = address;
			<WriteAsync>d__.values = values;
			<WriteAsync>d__.<>1__state = -1;
			<WriteAsync>d__.<>t__builder.Start<ModbusRtuOverTcp.<WriteAsync>d__44>(ref <WriteAsync>d__);
			return <WriteAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.ModBus.ModbusTcpNet.WriteAsync(System.String,System.Boolean)" />
		// Token: 0x06000FDD RID: 4061 RVA: 0x0005C398 File Offset: 0x0005A598
		[DebuggerStepThrough]
		public override Task<OperateResult> WriteAsync(string address, bool value)
		{
			ModbusRtuOverTcp.<WriteAsync>d__45 <WriteAsync>d__ = new ModbusRtuOverTcp.<WriteAsync>d__45();
			<WriteAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<WriteAsync>d__.<>4__this = this;
			<WriteAsync>d__.address = address;
			<WriteAsync>d__.value = value;
			<WriteAsync>d__.<>1__state = -1;
			<WriteAsync>d__.<>t__builder.Start<ModbusRtuOverTcp.<WriteAsync>d__45>(ref <WriteAsync>d__);
			return <WriteAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Core.IReadWriteNet.ReadInt32(System.String,System.UInt16)" />
		// Token: 0x06000FDE RID: 4062 RVA: 0x0005C3EC File Offset: 0x0005A5EC
		[HslMqttApi("ReadInt32Array", "")]
		public override OperateResult<int[]> ReadInt32(string address, ushort length)
		{
			IByteTransform transform = HslHelper.ExtractTransformParameter(ref address, base.ByteTransform);
			return ByteTransformHelper.GetResultFromBytes<int[]>(this.Read(address, length * base.WordLength * 2), (byte[] m) => transform.TransInt32(m, 0, (int)length));
		}

		/// <inheritdoc cref="M:HslCommunication.Core.IReadWriteNet.ReadUInt32(System.String,System.UInt16)" />
		// Token: 0x06000FDF RID: 4063 RVA: 0x0005C448 File Offset: 0x0005A648
		[HslMqttApi("ReadUInt32Array", "")]
		public override OperateResult<uint[]> ReadUInt32(string address, ushort length)
		{
			IByteTransform transform = HslHelper.ExtractTransformParameter(ref address, base.ByteTransform);
			return ByteTransformHelper.GetResultFromBytes<uint[]>(this.Read(address, length * base.WordLength * 2), (byte[] m) => transform.TransUInt32(m, 0, (int)length));
		}

		/// <inheritdoc cref="M:HslCommunication.Core.IReadWriteNet.ReadFloat(System.String,System.UInt16)" />
		// Token: 0x06000FE0 RID: 4064 RVA: 0x0005C4A4 File Offset: 0x0005A6A4
		[HslMqttApi("ReadFloatArray", "")]
		public override OperateResult<float[]> ReadFloat(string address, ushort length)
		{
			IByteTransform transform = HslHelper.ExtractTransformParameter(ref address, base.ByteTransform);
			return ByteTransformHelper.GetResultFromBytes<float[]>(this.Read(address, length * base.WordLength * 2), (byte[] m) => transform.TransSingle(m, 0, (int)length));
		}

		/// <inheritdoc cref="M:HslCommunication.Core.IReadWriteNet.ReadInt64(System.String,System.UInt16)" />
		// Token: 0x06000FE1 RID: 4065 RVA: 0x0005C500 File Offset: 0x0005A700
		[HslMqttApi("ReadInt64Array", "")]
		public override OperateResult<long[]> ReadInt64(string address, ushort length)
		{
			IByteTransform transform = HslHelper.ExtractTransformParameter(ref address, base.ByteTransform);
			return ByteTransformHelper.GetResultFromBytes<long[]>(this.Read(address, length * base.WordLength * 4), (byte[] m) => transform.TransInt64(m, 0, (int)length));
		}

		/// <inheritdoc cref="M:HslCommunication.Core.IReadWriteNet.ReadUInt64(System.String,System.UInt16)" />
		// Token: 0x06000FE2 RID: 4066 RVA: 0x0005C55C File Offset: 0x0005A75C
		[HslMqttApi("ReadUInt64Array", "")]
		public override OperateResult<ulong[]> ReadUInt64(string address, ushort length)
		{
			IByteTransform transform = HslHelper.ExtractTransformParameter(ref address, base.ByteTransform);
			return ByteTransformHelper.GetResultFromBytes<ulong[]>(this.Read(address, length * base.WordLength * 4), (byte[] m) => transform.TransUInt64(m, 0, (int)length));
		}

		/// <inheritdoc cref="M:HslCommunication.Core.IReadWriteNet.ReadDouble(System.String,System.UInt16)" />
		// Token: 0x06000FE3 RID: 4067 RVA: 0x0005C5B8 File Offset: 0x0005A7B8
		[HslMqttApi("ReadDoubleArray", "")]
		public override OperateResult<double[]> ReadDouble(string address, ushort length)
		{
			IByteTransform transform = HslHelper.ExtractTransformParameter(ref address, base.ByteTransform);
			return ByteTransformHelper.GetResultFromBytes<double[]>(this.Read(address, length * base.WordLength * 4), (byte[] m) => transform.TransDouble(m, 0, (int)length));
		}

		/// <inheritdoc cref="M:HslCommunication.Core.IReadWriteNet.Write(System.String,System.Int32[])" />
		// Token: 0x06000FE4 RID: 4068 RVA: 0x0005C614 File Offset: 0x0005A814
		[HslMqttApi("WriteInt32Array", "")]
		public override OperateResult Write(string address, int[] values)
		{
			IByteTransform byteTransform = HslHelper.ExtractTransformParameter(ref address, base.ByteTransform);
			return this.Write(address, byteTransform.TransByte(values));
		}

		/// <inheritdoc cref="M:HslCommunication.Core.IReadWriteNet.Write(System.String,System.UInt32[])" />
		// Token: 0x06000FE5 RID: 4069 RVA: 0x0005C644 File Offset: 0x0005A844
		[HslMqttApi("WriteUInt32Array", "")]
		public override OperateResult Write(string address, uint[] values)
		{
			IByteTransform byteTransform = HslHelper.ExtractTransformParameter(ref address, base.ByteTransform);
			return this.Write(address, byteTransform.TransByte(values));
		}

		/// <inheritdoc cref="M:HslCommunication.Core.IReadWriteNet.Write(System.String,System.Single[])" />
		// Token: 0x06000FE6 RID: 4070 RVA: 0x0005C674 File Offset: 0x0005A874
		[HslMqttApi("WriteFloatArray", "")]
		public override OperateResult Write(string address, float[] values)
		{
			IByteTransform byteTransform = HslHelper.ExtractTransformParameter(ref address, base.ByteTransform);
			return this.Write(address, byteTransform.TransByte(values));
		}

		/// <inheritdoc cref="M:HslCommunication.Core.IReadWriteNet.Write(System.String,System.Int64[])" />
		// Token: 0x06000FE7 RID: 4071 RVA: 0x0005C6A4 File Offset: 0x0005A8A4
		[HslMqttApi("WriteInt64Array", "")]
		public override OperateResult Write(string address, long[] values)
		{
			IByteTransform byteTransform = HslHelper.ExtractTransformParameter(ref address, base.ByteTransform);
			return this.Write(address, byteTransform.TransByte(values));
		}

		/// <inheritdoc cref="M:HslCommunication.Core.IReadWriteNet.Write(System.String,System.UInt64[])" />
		// Token: 0x06000FE8 RID: 4072 RVA: 0x0005C6D4 File Offset: 0x0005A8D4
		[HslMqttApi("WriteUInt64Array", "")]
		public override OperateResult Write(string address, ulong[] values)
		{
			IByteTransform byteTransform = HslHelper.ExtractTransformParameter(ref address, base.ByteTransform);
			return this.Write(address, byteTransform.TransByte(values));
		}

		/// <inheritdoc cref="M:HslCommunication.Core.IReadWriteNet.Write(System.String,System.Double[])" />
		// Token: 0x06000FE9 RID: 4073 RVA: 0x0005C704 File Offset: 0x0005A904
		[HslMqttApi("WriteDoubleArray", "")]
		public override OperateResult Write(string address, double[] values)
		{
			IByteTransform byteTransform = HslHelper.ExtractTransformParameter(ref address, base.ByteTransform);
			return this.Write(address, byteTransform.TransByte(values));
		}

		/// <inheritdoc cref="M:HslCommunication.Core.IReadWriteNet.ReadInt32Async(System.String,System.UInt16)" />
		// Token: 0x06000FEA RID: 4074 RVA: 0x0005C734 File Offset: 0x0005A934
		[DebuggerStepThrough]
		public override Task<OperateResult<int[]>> ReadInt32Async(string address, ushort length)
		{
			ModbusRtuOverTcp.<ReadInt32Async>d__58 <ReadInt32Async>d__ = new ModbusRtuOverTcp.<ReadInt32Async>d__58();
			<ReadInt32Async>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<int[]>>.Create();
			<ReadInt32Async>d__.<>4__this = this;
			<ReadInt32Async>d__.address = address;
			<ReadInt32Async>d__.length = length;
			<ReadInt32Async>d__.<>1__state = -1;
			<ReadInt32Async>d__.<>t__builder.Start<ModbusRtuOverTcp.<ReadInt32Async>d__58>(ref <ReadInt32Async>d__);
			return <ReadInt32Async>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Core.IReadWriteNet.ReadUInt32Async(System.String,System.UInt16)" />
		// Token: 0x06000FEB RID: 4075 RVA: 0x0005C788 File Offset: 0x0005A988
		[DebuggerStepThrough]
		public override Task<OperateResult<uint[]>> ReadUInt32Async(string address, ushort length)
		{
			ModbusRtuOverTcp.<ReadUInt32Async>d__59 <ReadUInt32Async>d__ = new ModbusRtuOverTcp.<ReadUInt32Async>d__59();
			<ReadUInt32Async>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<uint[]>>.Create();
			<ReadUInt32Async>d__.<>4__this = this;
			<ReadUInt32Async>d__.address = address;
			<ReadUInt32Async>d__.length = length;
			<ReadUInt32Async>d__.<>1__state = -1;
			<ReadUInt32Async>d__.<>t__builder.Start<ModbusRtuOverTcp.<ReadUInt32Async>d__59>(ref <ReadUInt32Async>d__);
			return <ReadUInt32Async>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Core.IReadWriteNet.ReadFloatAsync(System.String,System.UInt16)" />
		// Token: 0x06000FEC RID: 4076 RVA: 0x0005C7DC File Offset: 0x0005A9DC
		[DebuggerStepThrough]
		public override Task<OperateResult<float[]>> ReadFloatAsync(string address, ushort length)
		{
			ModbusRtuOverTcp.<ReadFloatAsync>d__60 <ReadFloatAsync>d__ = new ModbusRtuOverTcp.<ReadFloatAsync>d__60();
			<ReadFloatAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<float[]>>.Create();
			<ReadFloatAsync>d__.<>4__this = this;
			<ReadFloatAsync>d__.address = address;
			<ReadFloatAsync>d__.length = length;
			<ReadFloatAsync>d__.<>1__state = -1;
			<ReadFloatAsync>d__.<>t__builder.Start<ModbusRtuOverTcp.<ReadFloatAsync>d__60>(ref <ReadFloatAsync>d__);
			return <ReadFloatAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Core.IReadWriteNet.ReadInt64Async(System.String,System.UInt16)" />
		// Token: 0x06000FED RID: 4077 RVA: 0x0005C830 File Offset: 0x0005AA30
		[DebuggerStepThrough]
		public override Task<OperateResult<long[]>> ReadInt64Async(string address, ushort length)
		{
			ModbusRtuOverTcp.<ReadInt64Async>d__61 <ReadInt64Async>d__ = new ModbusRtuOverTcp.<ReadInt64Async>d__61();
			<ReadInt64Async>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<long[]>>.Create();
			<ReadInt64Async>d__.<>4__this = this;
			<ReadInt64Async>d__.address = address;
			<ReadInt64Async>d__.length = length;
			<ReadInt64Async>d__.<>1__state = -1;
			<ReadInt64Async>d__.<>t__builder.Start<ModbusRtuOverTcp.<ReadInt64Async>d__61>(ref <ReadInt64Async>d__);
			return <ReadInt64Async>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Core.IReadWriteNet.ReadUInt64Async(System.String,System.UInt16)" />
		// Token: 0x06000FEE RID: 4078 RVA: 0x0005C884 File Offset: 0x0005AA84
		[DebuggerStepThrough]
		public override Task<OperateResult<ulong[]>> ReadUInt64Async(string address, ushort length)
		{
			ModbusRtuOverTcp.<ReadUInt64Async>d__62 <ReadUInt64Async>d__ = new ModbusRtuOverTcp.<ReadUInt64Async>d__62();
			<ReadUInt64Async>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<ulong[]>>.Create();
			<ReadUInt64Async>d__.<>4__this = this;
			<ReadUInt64Async>d__.address = address;
			<ReadUInt64Async>d__.length = length;
			<ReadUInt64Async>d__.<>1__state = -1;
			<ReadUInt64Async>d__.<>t__builder.Start<ModbusRtuOverTcp.<ReadUInt64Async>d__62>(ref <ReadUInt64Async>d__);
			return <ReadUInt64Async>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Core.IReadWriteNet.ReadDoubleAsync(System.String,System.UInt16)" />
		// Token: 0x06000FEF RID: 4079 RVA: 0x0005C8D8 File Offset: 0x0005AAD8
		[DebuggerStepThrough]
		public override Task<OperateResult<double[]>> ReadDoubleAsync(string address, ushort length)
		{
			ModbusRtuOverTcp.<ReadDoubleAsync>d__63 <ReadDoubleAsync>d__ = new ModbusRtuOverTcp.<ReadDoubleAsync>d__63();
			<ReadDoubleAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<double[]>>.Create();
			<ReadDoubleAsync>d__.<>4__this = this;
			<ReadDoubleAsync>d__.address = address;
			<ReadDoubleAsync>d__.length = length;
			<ReadDoubleAsync>d__.<>1__state = -1;
			<ReadDoubleAsync>d__.<>t__builder.Start<ModbusRtuOverTcp.<ReadDoubleAsync>d__63>(ref <ReadDoubleAsync>d__);
			return <ReadDoubleAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Core.IReadWriteNet.WriteAsync(System.String,System.Int32[])" />
		// Token: 0x06000FF0 RID: 4080 RVA: 0x0005C92C File Offset: 0x0005AB2C
		[DebuggerStepThrough]
		public override Task<OperateResult> WriteAsync(string address, int[] values)
		{
			ModbusRtuOverTcp.<WriteAsync>d__64 <WriteAsync>d__ = new ModbusRtuOverTcp.<WriteAsync>d__64();
			<WriteAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<WriteAsync>d__.<>4__this = this;
			<WriteAsync>d__.address = address;
			<WriteAsync>d__.values = values;
			<WriteAsync>d__.<>1__state = -1;
			<WriteAsync>d__.<>t__builder.Start<ModbusRtuOverTcp.<WriteAsync>d__64>(ref <WriteAsync>d__);
			return <WriteAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Core.IReadWriteNet.WriteAsync(System.String,System.UInt32[])" />
		// Token: 0x06000FF1 RID: 4081 RVA: 0x0005C980 File Offset: 0x0005AB80
		[DebuggerStepThrough]
		public override Task<OperateResult> WriteAsync(string address, uint[] values)
		{
			ModbusRtuOverTcp.<WriteAsync>d__65 <WriteAsync>d__ = new ModbusRtuOverTcp.<WriteAsync>d__65();
			<WriteAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<WriteAsync>d__.<>4__this = this;
			<WriteAsync>d__.address = address;
			<WriteAsync>d__.values = values;
			<WriteAsync>d__.<>1__state = -1;
			<WriteAsync>d__.<>t__builder.Start<ModbusRtuOverTcp.<WriteAsync>d__65>(ref <WriteAsync>d__);
			return <WriteAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Core.IReadWriteNet.WriteAsync(System.String,System.Single[])" />
		// Token: 0x06000FF2 RID: 4082 RVA: 0x0005C9D4 File Offset: 0x0005ABD4
		[DebuggerStepThrough]
		public override Task<OperateResult> WriteAsync(string address, float[] values)
		{
			ModbusRtuOverTcp.<WriteAsync>d__66 <WriteAsync>d__ = new ModbusRtuOverTcp.<WriteAsync>d__66();
			<WriteAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<WriteAsync>d__.<>4__this = this;
			<WriteAsync>d__.address = address;
			<WriteAsync>d__.values = values;
			<WriteAsync>d__.<>1__state = -1;
			<WriteAsync>d__.<>t__builder.Start<ModbusRtuOverTcp.<WriteAsync>d__66>(ref <WriteAsync>d__);
			return <WriteAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Core.IReadWriteNet.WriteAsync(System.String,System.Int64[])" />
		// Token: 0x06000FF3 RID: 4083 RVA: 0x0005CA28 File Offset: 0x0005AC28
		[DebuggerStepThrough]
		public override Task<OperateResult> WriteAsync(string address, long[] values)
		{
			ModbusRtuOverTcp.<WriteAsync>d__67 <WriteAsync>d__ = new ModbusRtuOverTcp.<WriteAsync>d__67();
			<WriteAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<WriteAsync>d__.<>4__this = this;
			<WriteAsync>d__.address = address;
			<WriteAsync>d__.values = values;
			<WriteAsync>d__.<>1__state = -1;
			<WriteAsync>d__.<>t__builder.Start<ModbusRtuOverTcp.<WriteAsync>d__67>(ref <WriteAsync>d__);
			return <WriteAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Core.IReadWriteNet.WriteAsync(System.String,System.UInt64[])" />
		// Token: 0x06000FF4 RID: 4084 RVA: 0x0005CA7C File Offset: 0x0005AC7C
		[DebuggerStepThrough]
		public override Task<OperateResult> WriteAsync(string address, ulong[] values)
		{
			ModbusRtuOverTcp.<WriteAsync>d__68 <WriteAsync>d__ = new ModbusRtuOverTcp.<WriteAsync>d__68();
			<WriteAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<WriteAsync>d__.<>4__this = this;
			<WriteAsync>d__.address = address;
			<WriteAsync>d__.values = values;
			<WriteAsync>d__.<>1__state = -1;
			<WriteAsync>d__.<>t__builder.Start<ModbusRtuOverTcp.<WriteAsync>d__68>(ref <WriteAsync>d__);
			return <WriteAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Core.IReadWriteNet.WriteAsync(System.String,System.Double[])" />
		// Token: 0x06000FF5 RID: 4085 RVA: 0x0005CAD0 File Offset: 0x0005ACD0
		[DebuggerStepThrough]
		public override Task<OperateResult> WriteAsync(string address, double[] values)
		{
			ModbusRtuOverTcp.<WriteAsync>d__69 <WriteAsync>d__ = new ModbusRtuOverTcp.<WriteAsync>d__69();
			<WriteAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<WriteAsync>d__.<>4__this = this;
			<WriteAsync>d__.address = address;
			<WriteAsync>d__.values = values;
			<WriteAsync>d__.<>1__state = -1;
			<WriteAsync>d__.<>t__builder.Start<ModbusRtuOverTcp.<WriteAsync>d__69>(ref <WriteAsync>d__);
			return <WriteAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc />
		// Token: 0x06000FF6 RID: 4086 RVA: 0x0005CB22 File Offset: 0x0005AD22
		public override string ToString()
		{
			return string.Format("ModbusRtuOverTcp[{0}:{1}]", this.IpAddress, this.Port);
		}

		// Token: 0x04000438 RID: 1080
		private byte station = 1;

		// Token: 0x04000439 RID: 1081
		private bool isAddressStartWithZero = true;
	}
}
